require 'wpspider/common/cgi'
require 'wpspider/webservice/search_command'

module WPSpider
  module WebService
    class SearchCGI
      def SearchCGI::start()
        Common::CGI::start() do |http_req, http_res|
          http_res.set_content_type('text/xml')
          http_res.set_charset('UTF-8')
          name = http_req.get_param('name', 0).to_s()
          command = SearchCommand.new()
          command.name = name
          result = command.execute()
          http_res.set_body(result)
        end
      end
    end
  end
end
